<template>
  <a-input v-model:value="val" @change="change" />
</template>

<script>
import { ref } from "@vue/reactivity";

export default {
  props: {
    currentVal: {
      //当前选中值
      type: String,
      required: true,
    },
  },
  setup(props, { emit }) {
    const val = ref(props.currentVal);

    const change = (event) => {
      emit("update:currentVal", event.target.value);
    };

    return {
      val,
      change,
    };
  },
};
</script>

<style>
</style>